package day8;

/**
 * @author oldliu
 * @since 1.0
 */
public class DownloadThread extends Thread {
    private final String file;

    public DownloadThread(String name, String file){
        super(name);
        this.file=file;
    }

    @Override
    public void run() {
        System.out.println(super.getName()+"正在下载"+file);
        for(int i=1;i<=10;i++){
            try {
                Thread.sleep(400);
                System.out.println(super.getName()+"下载了100k字节");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
    }
}
